<?php
define('BEVIN', TRUE);
include_once("include/common.inc.php");
$uid = $user->checkUserLogin();
if($uid) {
	message("您已登陆！",'index.php');
}

if($_POST['submit']) {
	if($_POST['username'] && $_POST['password']) {
		$username = str_clear($_POST['username']);
		if($user->login($username,$_POST['password'])) {
			message("您已登陆成功！",'index.php');
		}
	} else {
		message("请输入正确填写您的用户名和密码！",'login.php');
	}
}

$smarty->display('login.html');
?>